import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
import Search from '../views/Search'
import Login from '../views/Login'
import Register from '../views/Register'
import Detail from '../views/Detail'
import AddCartSuccess from "../views/AddCartSuccess"
import ShopCarts from "../views/ShopCarts"
import Trade from "../views/Trade";
import Pay from "../views/Pay";
import PaySuccess from "../views/PaySuccess";
import Center from "../views/Center";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/search/:keyword?',
    name: 'Search',
    component: Search
  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
    meta:{
      isFooter:true
    }
  },
  {
    path: '/register',
    name: 'Register',
    component: Register,
    meta:{
      isFooter:true
    }
  },
  {
    path:"/detail/:id",
    name:"Detail",
    component:Detail,
  },
  {
    path:"/addcartsuccess",
    name:"AddCartSuccess",
    component:AddCartSuccess,
  },
  {
    path:"/shopcarts",
    name:"ShopCarts",
    component:ShopCarts,
  },
  {
    path: "/trade",
    name: "Trade",
    component: Trade,
  },
  {
    path: "/pay",
    name: "Pay",
    component: Pay,
  },
  {
    path: "/paysuccess",
    name: "PaySuccess",
    component: PaySuccess,
  },
  {
    path: "/center",
    name: "Center",
    component: Center,
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
